package com.twu.biblioteca.book;

import com.twu.biblioteca.library.BookNumber;

import java.util.HashMap;
import java.util.Map;

public class BookFactory {

	private Map<Integer, Book> books = new HashMap<Integer, Book>();

	public BookFactory() {
		books.put(BookNumber.EXTREME_PROGRAMMING_EXPLAINED, new Book("Extreme Programming Explained: Embrace Change By Kent Beck", BookNumber.EXTREME_PROGRAMMING_EXPLAINED));
		books.put(BookNumber.REFACTORING, new Book("Refactoring Improving the Design of Existing Code by Martin Fowler", BookNumber.REFACTORING));
		books.put(BookNumber.TEST_DRIVEN_DEVELOPMENT, new Book("Test Driven Development: By Example By Kent Beck", BookNumber.TEST_DRIVEN_DEVELOPMENT));
	}

	public Book createBook(int bookNum) {
		return books.get(bookNum);
	}
}
